package cn.com.petrochina.lpm3.controller;


import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
public class IndexController {

    @GetMapping("index")
    public ModelAndView index(@RequestParam(required = false) String module,
                              @RequestParam(name = "url_my", required = false) String urlMy) {
        if (StringUtils.isNotEmpty(urlMy)) {
            return new ModelAndView(urlMy);
        }
        return new ModelAndView("index");
    }

    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }
}
